#!/bin/bash

install_compiler_software_support_list=("Bisheng_Compiler" "GCC_Compiler")
install_compiler_options=("[v]" "[v]")
install_compiler_description=(
"Bisheng Compiler"
"GCC Compiler")

install_compiler_prompt() {
    logInfo "Start installing Compiler..."
    logInfo "Please Enter (1-$1) to switch compiler selection, only checked compiler(s) will be installed."
    logInfo "Enter 'q' to quit, 'y' or enter to confirm compiler installation."
}

toggle_install_compiler_option() {
    local index=$1
    if [ "${install_compiler_options[index]}" == "[v]" ]; then
        install_compiler_options[index]="[x]"
    else
        install_compiler_options[index]="[v]"
    fi
    if [[ "${install_compiler_options[0]}" == "[x]" && "${install_compiler_options[1]}" == "[x]" ]]; then
        logError "Compiler installation is mandetary!"
        install_compiler_options[0]="[v]"
        install_compiler_options[1]="[v]"
        sleep 1
        delete_previous_and_current_line
    fi
}
